package com.sleepcamel.rest.domain;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class BaseBean {

	transient protected PropertyChangeSupport support = new PropertyChangeSupport(this);

	public void addPropertyChangeListener(PropertyChangeListener listener) {
		support.addPropertyChangeListener(listener);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener) {
		support.removePropertyChangeListener(listener);
	}

	public void removePropertyChangeListeners() {
		for( PropertyChangeListener propertyChangeListener:this.support.getPropertyChangeListeners()){
			support.removePropertyChangeListener(propertyChangeListener);
		}
	}
	
	public void firePropertyChange(String name, Object oldValue, Object newValue) {
		support.firePropertyChange(name, oldValue, newValue);
	}
}
